import React from 'react';
import ReactDOM from 'react-dom';
import { Link } from 'react-router';
import { Menu, Icon, Button } from 'antd';
// import $ from 'jquery';
import Styles from './css/index.css'; 
import stylesS from './css/list.css';
import Center from './component/center';
import Header_ from  './component/header'; 
import Management_ from './component/management_';   // 客服管理
import Doctor_  from  './component/doctor_';    // 医生管理
import Pharmacist_ from './component/pharmacist_';  // 药师管理
import Consulting  from './component/consulting';  // 咨询管理
import Health  from  './component/health';  // 健康管理

class index_all extends React.Component{

    constructor(props){
        super(props);
        this.state={
            open : false,
            list:{
                list_one:null,
                list_two:null,
                list_three:null,
                list_four:null,
            },
            list_:{
              list_one:null,
              list_two:null,
              list_three:null,
              list_four:null,
            }
        }
    }
    


//  首页

    open_list(e){

      
       let  list={
        list_one:1,
        list_two:null,
        list_three:null,
        list_four:null,
                }

        let list_={
            list_one:null,
            list_two:null,
            list_three:null,
            list_four:null,
        }        

        this.setState({
            list:list,
            list_:list_

        })
    
    }


    // 员工管理
    
    open_list_one(e){
       
        let  list={
            list_one:null,
            list_two:1,
            list_three:null,
            list_four:null,
        }
    
            this.setState({
                list:list,
                open:!this.state.open
            })

            console.log(this.state.open)
    }

    // 咨询管理

    open_list_two(e){

        let  list={
            list_one:null,
            list_two:null,
            list_three:1,
            list_four:null,
        }
    
        let list_={
            list_one:null,
            list_two:null,
            list_three:null,
            list_four:null,
        }
       
        
    
       this.setState({
                list:list,
                list_:list_
    
        })
    }

   // 健康档案

    open_list_three(e){

        let  list={
            list_one:null,
            list_two:null,
            list_three:null,
            list_four:1,
        }

        let list_={
            list_one:null,
            list_two:null,
            list_three:null,
            list_four:null,
        }
       
        
    
       this.setState({
                list:list,
                list_:list_
    
        })
    }

    //*****************************************************  员工管理
    // 客服管理
    Staff_member_one(e){
          
        let list_={
            list_one:1,
            list_two:null,
            list_three:null,
            list_four:null,
          }
        
          let  list={
            list_one:null,
            list_two:1,
            list_three:null,
            list_four:null,
        }  
        
          this.setState({
            list_:list_,
            list:list
          })
    }
    // 医生管理
    Staff_member_two(e){
        
        let list_={
            list_one:null,
            list_two:1,
            list_three:null,
            list_four:null,
          }
        
          let  list={
            list_one:null,
            list_two:1,
            list_three:null,
            list_four:null,
        }  
        
          this.setState({
            list_:list_,
            list:list
          })

    }
    // 药师管理
    Staff_member_three(e){
         

        let list_={
            list_one:null,
            list_two:null,
            list_three:1,
            list_four:null,
          }
        let  list={
            list_one:null,
            list_two:1,
            list_three:null,
            list_four:null,
        }  
        
          this.setState({
            list_:list_,
            list:list
          })
    }





        render(){

              return(
                <div className="index_all">
                
             
                      <Header_/>
              
            
                   <div className="box_flex_row">
                       
                        
                   <div className="List_s">
                   
                         
                                 
                                   <div className="nav_header_">
                                       <div className="nav_header_icon">
                                         <img src="./img/headerpic.png"  className="icon_header_list"  />    <span className="list_admin">Admin</span>
                                       </div> 
                                       
                                       <ul className="The_sidebar"  >
                                       <li className="The_sidebar_one"  > 
                                        
                                       <div  className={this.state.list.list_one==1?'list_all_style':'list_all_style_'}    onClick={this.open_list.bind(this)} > 
                                        <div className="Home_management">
                                         <span>首页</span> <span>></span>  
                                        </div>
                                       </div>
                                       
                                       </li>
                                       <li  className="The_sidebar_two" > 
                                        
                                       <div  className={this.state.list.list_two==1?'list_all_style':'list_all_style_'}   onClick={this.open_list_one.bind(this)} >
                                          <div className="Staff_management">
                                           <span>员工管理</span> <span>></span>  
                                          </div>
                                       </div>  
                                          
                                        <div className={this.state.open==true?'Staff_member_Height':'Staff_member_notHeight'}>
                                          <div className="management_show">
                                              <ul className="management_show_list_">
                                                  <li  onClick={this.Staff_member_one.bind(this)}  className={this.state.list_.list_one==1?'h1':''}  >●  客服管理</li>
                                                  <li  onClick={this.Staff_member_two.bind(this)}  className={this.state.list_.list_two==1?'h1':''}  >●  医生管理</li>
                                                  <li  onClick={this.Staff_member_three.bind(this)} className={this.state.list_.list_three==1?'h1':''} >●  药师管理</li>
                                              </ul>
                                          </div>
                                        </div>  
                                        
                                        </li>
                                       <li> 
                   
                                       <div  className={this.state.list.list_three==1?'list_all_style':'list_all_style_'}   onClick={this.open_list_two.bind(this)}>
                                          <div className="Management_consulting">
                                          <span>咨询分类管理</span> <span>></span>
                                          </div>
                                       </div>
                   
                                       </li>
                   
                   
                                       <li> 
                                       <div  className={this.state.list.list_four==1?'list_all_style':'list_all_style_'}   onClick={this.open_list_three.bind(this)} >       
                                         <div className="Health_management">
                                        <span>健康档案管理 </span> <span>></span>
                                         </div>
                                       </div>     
                                       </li>
                             
                                       </ul>
                                   </div>
                   
                      
                                  
                         </div>
                       
                       
                               <div className={this.state.list.list_one==1?'block':'none'}> 
                                     <Center/> 
                               </div>

                               <div className={this.state.list_.list_one==1?'block':'none'}>
                                      <Management_/>
                               </div>

                               <div className={this.state.list_.list_two==1?'block':'none'} >
                                     <Doctor_/>
                               </div>

                               <div className={this.state.list_.list_three==1?'block':'none'} >
                                    <Pharmacist_/>  
                               </div>

                               <div className={this.state.list.list_three==1?'block':'none'}>
                                    <Consulting/>
                               </div>

                               <div className={this.state.list.list_four==1?'block':'none'}>
                                    <Health/>
                               </div>
                              
                   </div>
            
                   
                </div>
              )
        }
}



export default index_all;